#include <iostream>
#include <string>

#include "ImageProjection.h"

int main()
{
	cout << "image_projection\n";
	Mat imgSrc, imgGray, imgBinary;
	ImageProjection imageProjection;
	imgSrc = imread("data\\image_original.png");
	if (imgSrc.empty())
	{
		cerr << "->Image loading Error\n";
		return -1;
	}
	if (imgSrc.channels() == 3)
		cvtColor(imgSrc, imgGray, COLOR_BGR2GRAY);
	else
		imgGray = imgSrc;
	threshold(imgGray, imgBinary, 128, 255, THRESH_BINARY);
	imshow("image_srcous", imgSrc);
	imshow("image_gray", imgGray);
	imshow("image_binary", imgBinary);

	imageProjection.picshadowx(imgBinary);
	imageProjection.picshadowy(imgBinary);

	cout << "finish\n";
	waitKey(0);
	return 0;
}